Automatic Mode Inference for Logic Programs
نویسندگان
چکیده
In general, logic programs are undirected, i.e. there is no concept of ‘‘input’’ and ‘‘output’’ arguments to a procedure. An argument may be used either as an input or as an output argument, and programs may be executed either in a ‘‘forward’’ direction or in a ‘‘backward’’ direction. However, it is often the case that in a given program, a predicate is used with some of its arguments used consistently as input arguments and others as output arguments. Such mode information can be used by a compiler to effect various optimizations. This paper considers the problem of automatically inferring the modes of the predicates in a program. The dataflow analysis we use is more powerful than approaches relying on syntactic characteristics of programs, e.g. [18]. Our work differs from that of Mellish [14, 15] in that (i) we give a sound and efficient treatment of variable aliasing in mode inference; (ii) by propagating instantiation information using state transformations rather than through dependencies between variables, we achieve greater precision in the treatment of unification, e.g. through =/2; and (iii) we describe an efficient implementation based on the dynamic generation of customized mode interpreters. Several optimizations to improve the performance of the mode inference algorithm are described, as are various program optimizations based on mode information. hhhhhhhhhhhhhhhhhhhhhhhhhhhhh This work was supported in part by the National Science Foundation under grant number DCR-8407688. † This is a revised version of a paper presented at the Third Symposium on Logic Programming, Salt Lake City, Utah, Sept. 1986.
منابع مشابه
A Prioritization Model for HSE Risk Assessment Using Combined Failure Mode, Effect Analysis, and Fuzzy Inference System: A Case Study in Iranian Construction Industry
The unavailability of sufficient data and uncertainty in modeling, some techniques, and decision-making processes play a significant role in many engineering and management problems. Attain to sure solutions for a problem under accurate consideration is essential. In this paper, an application of fuzzy inference system for modeling the indeterminacy involved in the problem of HSE risk assessm...
متن کاملGovernor design for hydropower plants by intelligent sliding mode variable structure control
This work proposes a neural-fuzzy sliding mode control scheme for a hydro-turbine speed governor system. Considering the assumption of elastic water hammer, a nonlinear mode of the hydro-turbine governor system is established. By linearizing this mode, a sliding mode controller is designed. The linearized mode is subject to uncertainties. The uncertainties are generated in the process of linear...
متن کاملA descriptive Mode Inference for Logic
In general, an n-ary predicate (relation) describes the relationship among its arguments, and such that no argument has to be of a special mode. The uniication and the resolution (SLDNF-resolution) do capture this state of aaair. Hence, the aim of logic programming is in some point approximatively achieved if the system is able to automatically determine the descriptive mode of an n-ary predica...
متن کاملAutomatic Complexity Analysis of Logic Programs
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 12 CHAPTER 1: INTRODUCTION .. 1.1 Complexity Analysis of Programs ... 1.2 Automatic Complexity Analysis of Programs 1.2.1 Imperative Programs . 1.2.2 Functional Programs . 1.2.3 Logic Programs . . . . . 1.3 Applications of Automatic Complexity Analysis. 1.4 Contributions .......... . 1.5 Organization of the Dissertatio...
متن کاملAutomatic Termination Analysis of
This paper describes a system implemented in SICStus Prolog for automatically checking left termination of logic programs. Given a program and query, the system answers either that the query terminates or that there may be non-termination. The system can use any norm of a wide family of norms. It can handle automatically most of the examples found in the literature on termination of logic progr...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- J. Log. Program.
دوره 5 شماره
صفحات -
تاریخ انتشار 1988